// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_REP_APPLICATION_ITEM
// * CreateDate    : 2014-06-05 18:30:31
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:30:31
// * LastChanger   : 2014-06-05 18:30:31
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class RepApplicationItemEntity : EntityBase
    {
        public RepApplicationItemTable TableSchema
        {
            get
            {
                return RepApplicationItemTable.Current;
            }
		}
		
		public RepApplicationItemEntity()
        {

        }
		
		public RepApplicationItemEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.RepApplicationItemId = Convert.ToString(CommonFunctions.ToObject(dr["REP_APPLICATION_ITEM_ID"]));
			this.RepApplicationId = Convert.ToString(CommonFunctions.ToObject(dr["REP_APPLICATION_ID"]));
			this.RelatedOrderItemId = Convert.ToString(CommonFunctions.ToObject(dr["RELATED_ORDER_ITEM_ID"]));
			this.ProductCode = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_CODE"]));
			this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
			this.PlanFinishedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["PLAN_FINISHED_DATE"]));
			this.RepairReason = Convert.ToString(CommonFunctions.ToObject(dr["REPAIR_REASON"]));
			this.Status = Convert.ToInt32(CommonFunctions.ToObject(dr["STATUS"]));
        }
		
		public RepApplicationItemEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.RepApplicationItemId = Convert.ToString(CommonFunctions.ToObject(dr["REP_APPLICATION_ITEM_ID"]));
			this.RepApplicationId = Convert.ToString(CommonFunctions.ToObject(dr["REP_APPLICATION_ID"]));
			this.RelatedOrderItemId = Convert.ToString(CommonFunctions.ToObject(dr["RELATED_ORDER_ITEM_ID"]));
			this.ProductCode = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_CODE"]));
			this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
			this.PlanFinishedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["PLAN_FINISHED_DATE"]));
			this.RepairReason = Convert.ToString(CommonFunctions.ToObject(dr["REPAIR_REASON"]));
			this.Status = Convert.ToInt32(CommonFunctions.ToObject(dr["STATUS"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return RepApplicationItemTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string RepApplicationItemId
        {
            get { return Convert.ToString(GetData(RepApplicationItemTable.C_REP_APPLICATION_ITEM_ID)); }
            set { SetData(RepApplicationItemTable.C_REP_APPLICATION_ITEM_ID, value); }
        }
		
        [DataMember]
        public string RepApplicationId
        {
            get { return Convert.ToString(GetData(RepApplicationItemTable.C_REP_APPLICATION_ID)); }
            set { SetData(RepApplicationItemTable.C_REP_APPLICATION_ID, value); }
        }
		
        [DataMember]
        public string RelatedOrderItemId
        {
            get { return Convert.ToString(GetData(RepApplicationItemTable.C_RELATED_ORDER_ITEM_ID)); }
            set { SetData(RepApplicationItemTable.C_RELATED_ORDER_ITEM_ID, value); }
        }
		
        [DataMember]
        public string ProductCode
        {
            get { return Convert.ToString(GetData(RepApplicationItemTable.C_PRODUCT_CODE)); }
            set { SetData(RepApplicationItemTable.C_PRODUCT_CODE, value); }
        }
		
        [DataMember]
        public decimal Qty
        {
            get { return Convert.ToDecimal(GetData(RepApplicationItemTable.C_QTY)); }
            set { SetData(RepApplicationItemTable.C_QTY, value); }
        }
		
        [DataMember]
        public DateTime PlanFinishedDate
        {
            get { return Convert.ToDateTime(GetData(RepApplicationItemTable.C_PLAN_FINISHED_DATE)); }
            set { SetData(RepApplicationItemTable.C_PLAN_FINISHED_DATE, value); }
        }
		
        [DataMember]
        public string RepairReason
        {
            get { return Convert.ToString(GetData(RepApplicationItemTable.C_REPAIR_REASON)); }
            set { SetData(RepApplicationItemTable.C_REPAIR_REASON, value); }
        }
		
        [DataMember]
        public int Status
        {
            get { return Convert.ToInt32(GetData(RepApplicationItemTable.C_STATUS)); }
            set { SetData(RepApplicationItemTable.C_STATUS, value); }
        }
		
		#endregion
	}
	
	
}	

